﻿package com.gengine.resource.loader
{
    import com.fyGame.fyMap.*;
    import flash.utils.*;

    public class MapDataLoader extends BaseLoader
    {
        private var _mapInfo:FyMapInfo = null;

        public function MapDataLoader()
        {
            return;
        }// end function

        public function get mapInfo() : FyMapInfo
        {
            return this._mapInfo;
        }// end function

        override public function getClass() : Class
        {
            return MapDataLoader;
        }// end function

        override public function initialize(param1) : void
        {
            if (!(param1 is ByteArray))
            {
                throw new Error("DataResource can only handle ByteArrays.");
            }
            var _loc_2:* = new FyMapInfo();
            _loc_2.read(param1);
            this._mapInfo = _loc_2;
            if (resourceInfo)
            {
                resourceInfo.data = this._mapInfo;
            }
            onLoadCompleteHandler();
            return;
        }// end function

        override protected function onContentReady(param1) : Boolean
        {
            return this._mapInfo != null;
        }// end function

    }
}
